package com.myk.game.gobangchess.ai.shock;

public class Kill_judging_deep1 {

    public static int[] kill_judging_deep1(int[][] board) {
        int[] iskill = {0, 0};

        int[][] idx = If_go_push.if_go_push(board);

        if (idx.length > 0) {
            int idxsize = idx.length;

            int[][] boardBigger = new int[12][12];
            for (int i = 0; i < 12; i++) {
                for (int j = 0; j < 12; j++) {
                    boardBigger[i][j] = 9;
                }
            }

            for (int i = 2; i < 10; i++) {
                for (int j = 2; j < 10; j++) {
                    boardBigger[i][j] = board[i - 2][j - 2];
                }
            }

            for (int i = 0; i < idxsize; i++) {
                int yrangemin = idx[i][0] - 1;
                int xrangemin = idx[i][1] - 1;

                int[][] checkBoard = new int[6][6];
                for (int m = 0; m < 6; m++) {
                    for (int n = 0; n < 6; n++) {
                        checkBoard[m][n] = boardBigger[yrangemin + m][xrangemin + n];
                    }
                }

                int[] canWin = Winningtest_push.winningtest_push(checkBoard);
                if (canWin[0] == 1) {
                    iskill[0] = 1;
                }
                if (canWin[1] == 1) {
                    iskill[1] = 1;
                }
            }
        }

        int[] canWin = Winningtest.winningtest(board);
        if (canWin[0] == 1) {
            iskill[0] = 1;
        }
        if (canWin[1] == 1) {
            iskill[1] = 1;
        }

        return iskill;
    }

}
